import './css/index.css';
import React from 'react'
import {createRoot} from 'react-dom/client';
import App from "./views/App";
import {HashRouter as Router, Route, Routes,Navigate} from 'react-router-dom'
import Login from "./views/Login";
import Trades from "./views/components/Trades";
import Analysis from "./views/components/Analysis";
import Contacts from "./views/components/Contacts";
// import PrivateRoute from './routers/privateRouter';

function main() {
    const root = createRoot(document.getElementById('app'));
    root.render(
        <Router>
            <Routes>
                <Route path={"login"} element={<Login />}></Route>
                <Route path={"home/*"} element={<App />}>
                    <Route path="trades" element={<Trades/>} />
                    <Route path="contacts" element={<Contacts/>} />
                    <Route path="analysis" element={<Analysis/>} />
                    <Route path={"home"} element={<Navigate to="/home/trades"/>}></Route>
                </Route>
                <Route path={""} element={<Navigate to="/login"/>}></Route>
            </Routes>
        </Router>
    );
}

main()